package com.syyo.gulimall.product.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.syyo.gulimall.product.domain.entity.AttrEntity;
import com.syyo.gulimall.product.domain.entity.AttrGroupEntity;
import com.syyo.gulimall.product.domain.req.AttrGroupReq;
import com.syyo.gulimall.product.domain.resp.AttrGroupWithAttrsResp;
import com.syyo.gulimall.product.domain.vo.SpuItemAttrGroupVo;

import java.util.List;

/**
 * 属性分组
 *
 * @author syyo
 * @email syyo@gmail.com
 * @date 2021-01-20 09:32:12
 */
public interface AttrGroupService extends IService<AttrGroupEntity> {

    /**
     * 新增
     */
    int add(AttrGroupReq req);

    /**
     * 删除
     */
    int del(Integer id);

    /**
     * 编辑
     */
    int edit(AttrGroupReq req);

    /**
     * 详情
     */
    AttrGroupEntity findOne(Integer id);

    /**
     * 列表
     */
    IPage<AttrGroupEntity> findPage(Integer pageNum, Integer pageSize, AttrGroupReq req);

    List<AttrGroupEntity> findAll(Long catelogId);

    List<AttrEntity> findAllByGroupId(Long groupId);

    int delRelevance(Integer attrId, Integer groupId);

    IPage<AttrEntity> findAllNoRelevance(Long groupId, Integer pageNum, Integer pageSize);

    List<AttrGroupWithAttrsResp> findAttrAndGroupByCatelogId(Long catelogId);

    List<SpuItemAttrGroupVo> getAttrGroupWithAttrsBySpuId(Long spuId, Long catalogId);
}

